package com.example.jl.bethinner.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;

import com.example.jl.bethinner.R;
import com.example.jl.bethinner.base.BaseActivity;
import com.example.jl.bethinner.view.ACView;
import com.example.jl.bethinner.view.CustomView;

public class DIYViewActivity extends BaseActivity {

    ACView acView;
    SeekBar seek_bar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_diyview);
        seek_bar = (SeekBar)findViewById(R.id.seek_bar);


//        ObjectAnimator rotate = ObjectAnimator.ofFloat(customView, "rotation", 0f, 360f);
//        rotate.setDuration(5000);
//        rotate.start();



        seek_bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                int seekProgress = seekBar.getProgress();
                if(seekProgress<33){
                    seekBar.setProgress(0);
                }else if(seekProgress>=33 && seekProgress<68){
                    seekBar.setProgress(50);
                }else if(seekProgress>=66){
                    seekBar.setProgress(100);
                }
            }
        });


    }


}
